For each fact whose value is entered by the user, you need to define how the question is asked of the user. If the knowledgebase is run on the web, you can use HTML formatting in your prompt and menu choices.
KnowledgeWright implements three basic methods. They are:For menus, you have the option of have separate text for display purposes and for use in rules and tables. This is useful if you want to include HTML formatting in your menu choices (perhaps using an image), or if your choices have many words in them.
All questions share the following properties:
| Property Name | Description | Default Value | Required |
| id | The name of this object. See Object Names for details. | <none> | yes |
| path | The folder this object is located in. See Folders for details. | / | yes |
| description | A text description (comment)--not used during reasoning. | <none> | no |
| prompt | The text used to ask the user for a value. The prompt may contain other object names. | yes | |
| question_type | Type of question: fill_in_the_blank, menu_single_choice, menu_multiple_choices, menu_single_choice_display_separate, or menu_multiple_choices_display_separate (the latter two are for advanced users). | yes | |
| question_style | The HTML style in which the question is presented to the user. 'listbox' is a box containing the list of choices. 'checkbox_radio' is radio buttons for single choice, and checkboxes for multiple choice. | listbox | yes |
| ask_also | The list of related questions to ask when asking this question. It is a convenient way to group related questions together. Note, if the questions in the ask_also list use object names in their prompts, the values of those objects must be already known or the question will not be asked. | no | |
| default | The default answer for the question. | no |
The following properties apply only to fill-in-the-blank questions:
| Property Name | Description | Default Value | Required |
| answer_type | The type of the value: text, number, date or boolean. Dates are entered as YYYY-MM-DD. Boolean is entered as 'true' or 'false'. | text | yes |
| length | The maximum length of the fact value. | 20 | yes |
The following property applies only to menu questions if question_type is one of menu_single_choice or menu_multiple_choices:
| Property Name | Description | Default Value | Required |
| choices | The menu choices the user selects from. | <none> | yes |
The following property applies only to menu questions if question_type is one of menu_single_choice_display_separate or menu_multiple_choices_display_separate:
| Property Name | Description | Default Value | Required |
| rule-display_choices | A table containing the text value to be used in rules (conditions), and the text value to be displayed to the user. This is especially useful when your menu choice is long or contains HTML attributes or images. | <none> | yes |
Fill in the blank questions allow the user to type in a value. For example:
id |
error_code |
path |
/ |
prompt |
What error code was displayed or 'none'? |
question_type |
fill_in_the_blank |
length |
5 |
default |
none |
ask_also |
|
There are two types of menus. Single choice means that the fact can have only one value. Multiple choices means that the fact can have zero or more values. Single choice questions might have values like 'yes' and 'no', whereas a multiple choice question might ask what pets do you have and could have values like 'dogs', 'cats', 'fish', 'birds' and 'horses'.
For example:
id |
env_ver |
path |
/ |
prompt |
Environment and Version |
question_type |
menu_single_choice |
question_style |
checkbox_radio |
choices
|
Windows 98 Windows NT Windows 2000 Linux |
default |
|
ask_also |
|
If you want to use separate values for display and the rules, your question might look like this:
id |
env_ver |
||||||||||
path |
/ |
||||||||||
prompt |
Environment and Version |
||||||||||
question_type |
menu_single_choice |
||||||||||
question_style |
listbox |
||||||||||
rule-display_choices
|
|
||||||||||
default |
|
||||||||||
ask_also |
|
The user will see 'Windows 98', 'Windows NT 4.0', etc. as menu choices, whereas, your rule conditions will read:
env_ver = win98 or env_ver = win2k
Here is how related facts are added to a question:
id |
env_ver |
path |
/ |
prompt |
Environment and Version |
question_type |
menu_single_choice |
question_style |
checkbox_radio |
choices
|
Windows 98 Windows NT Windows 2000 Linux |
default |
|
ask_also |
memory_size processor_type |
This says that 'memory_size' and 'processor_type' are related to 'env_ver'. When the rules are executed, if KnowledgeWright is going to ask the user for env_ver, it will also ask for the other two questions as well. However, if the other two questions use object names in their prompts, and the values for those objects are not know, that question will not be asked.